import request from '@/utils/request'

// 查询分类品牌列表
export const GetCategoryBrandPage = (
  pageNum,
  pageSize,
  brandId,
  categoryId
) => {
  return request({
    url: `/admin/product/categoryBrand/page/${pageNum}/${pageSize}`,
    method: 'get',
    params: { brandId, categoryId },
  })
}
//新增
export const SaveCategoryBrand = data => {
  return request({
    url: `/admin/product/categoryBrand/save`,
    method: 'POST',
    data,
  })
}
//删除
export const DeleteCategoryBrandById = id => {
  return request({
    url: `/admin/product/categoryBrand/${id}`,
    method: 'DELETE',
  })
}
//根据id查询
export const GetCategoryBrandById = id => {
  return request({
    url: `/admin/product/categoryBrand/${id}`,
    method: 'GET',
  })
}
//更新
export const UpdateCategoryBrand = data => {
  return request({
    url: `/admin/product/categoryBrand/update`,
    method: 'PUT',
    data,
  })
}
//根据分类id查询品牌列表
export const FindBrandByCategoryId = cid => {
  return request({
    url: `/admin/product/categoryBrand/findBrandsByC3id/${cid}`,
    method: 'GET',
  })
}
